﻿
-- ================================================
-- Remarks: 
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'Ivy_SiteGeneralBasic_Feedbacks_GetByKey')
	BEGIN
		DROP  Procedure  Ivy_SiteGeneralBasic_Feedbacks_GetByKey
	END

GO

CREATE PROCEDURE [Ivy_SiteGeneralBasic_Feedbacks_GetByKey]
-- =============================================
-- Author:		<Ram praveshkr>
-- Create date: <09/12/2015>
-- Description:	<Ivy_SiteGeneralBasic_Feedbacks_GetByKey>
-- =============================================
-- Add the parameters for the stored procedure here
	(
	      @FeedbackKey int
	)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT OFF;

	SELECT   [Feedback].[FeedbackKey], 
	         [Feedback].[FeedbackUserKey], 
			 [Feedback].[FeedbackSubject], 
			 [Feedback].[FeedbackText], 
			 [Feedback].[FeedbackDate], 
			 [FeedbackUser].[FeedbackUserKey], 
             [FeedbackUser].[FeedbackUserName], 
			 [FeedbackUser].[FeedbackUserEmail], 
			 [FeedbackUser].[RegisteredUserKey]
    FROM     [Feedback] INNER JOIN [FeedbackUser] 
    ON       [Feedback].[FeedbackUserKey] = [FeedbackUser].[FeedbackUserKey]
    WHERE    (
	           [Feedback].[FeedbackKey] = @FeedbackKey
			 )
    ORDER BY Feedback.Sys_DateOfCreation
END
GO
